package com.ssy.wireless.web.vo.resp;

import java.io.Serializable;
import java.util.List;

/**
 * Created by cofey on 16/11/27.
 */
public class EchartsVo implements Serializable {
    private EchartsTitleVo title;
    private EchartsxAxisVo xAxis;
    private EchartsSeriesVo series;
    private EchartsLegendVo legend;

    public EchartsTitleVo getTitle() {
        return title;
    }

    public void setTitle(EchartsTitleVo title) {
        this.title = title;
    }

    public EchartsxAxisVo getxAxis() {
        return xAxis;
    }

    public void setxAxis(EchartsxAxisVo xAxis) {
        this.xAxis = xAxis;
    }

    public EchartsSeriesVo getSeries() {
        return series;
    }

    public void setSeries(EchartsSeriesVo series) {
        this.series = series;
    }

    public EchartsLegendVo getLegend() {
        return legend;
    }

    public void setLegend(EchartsLegendVo legend) {
        this.legend = legend;
    }

    public static EchartsVo build() {
        return new EchartsVo();
    }

    public EchartsVo createTitle(String text) {
        this.setTitle(new EchartsTitleVo().setText(text));
        return this;
    }

    public EchartsVo createLegend(List data) {
        this.setLegend(new EchartsLegendVo<>().setData(data));
        return this;
    }

    public EchartsVo createxAxis(List data) {
        this.setxAxis(new EchartsxAxisVo().setData(data));
        return this;
    }

    public EchartsVo createSeries(List data, String name, String type) {
        this.setSeries(new EchartsSeriesVo().setData(data).setName(name).setType(type));
        return this;
    }
}
